package it.tukano.reflection;

import it.tukano.fun.VFunction1;

/** A function that calls a method with one argument */
public class RefJump1<T> extends VFunction1<T> {
    
    private final MethodExt method;

    /**
     * Instance initializer
     * @param ref the instance whose method will be called
     * @param met the name of the method to call
     * @param param the type of the argument of the method to call
     */
    public RefJump1(Object ref, String met, Class<T> param) {
        this.method = new MethodExt(ref, met, param);
    }

    @Override
    protected void doApply(T p) {
        method.invoke();
    }
}
